I submitted this patch twice to gtk-devel-list, and received no comments,
authorElliot Lee <sopwith@cuc.ml.org>
Mon, 30 Nov 1998 19:07:15 +0000 (19:07 +0000)
committerElliot Lee <sopwith@src.gnome.org>
Mon, 30 Nov 1998 19:07:15 +0000 (19:07 +0000)
I submitted this patch twice to gtk-devel-list, and received no comments, so
am committing it.  Although not exhaustively tested, I have been using this
gtk+ for a week w/o problems, and I did read the code to ensure that nothing
ever writes to these data structures. If by chance people encounter SEGV's in
gtk+ code that is setting values in global data structures, this patch could
be a possible culprit.

1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>

* {gdk,gtk}/*.c: Make read-only data structures "static const" to
allow them to be shared, mainly including (but not limited to) the
GtkTypeInfo structures for each class.

* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.

116 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdk.c
gdk/gdkinput.c
gdk/gdkrgb.c
gdk/gdkvisual.c
gdk/gdkwindow.c
gdk/x11/gdkinput.c
gdk/x11/gdkmain-x11.c
gdk/x11/gdkvisual-x11.c
gdk/x11/gdkwindow-x11.c
gtk/gtkaccelgroup.c
gtk/gtkaccellabel.c
gtk/gtkadjustment.c
gtk/gtkalignment.c
gtk/gtkarrow.c
gtk/gtkaspectframe.c
gtk/gtkbbox.c
gtk/gtkbin.c
gtk/gtkbox.c
gtk/gtkbutton.c
gtk/gtkcalendar.c
gtk/gtkcheckbutton.c
gtk/gtkcheckmenuitem.c
gtk/gtkclist.c
gtk/gtkcolorsel.c
gtk/gtkcombo.c
gtk/gtkcontainer.c
gtk/gtkctree.c
gtk/gtkcurve.c
gtk/gtkdata.c
gtk/gtkdialog.c
gtk/gtkdnd.c
gtk/gtkdrawingarea.c
gtk/gtkdrawwindow.c
gtk/gtkeditable.c
gtk/gtkentry.c
gtk/gtkeventbox.c
gtk/gtkfilesel.c
gtk/gtkfixed.c
gtk/gtkfontsel.c
gtk/gtkframe.c
gtk/gtkgamma.c
gtk/gtkhandlebox.c
gtk/gtkhbbox.c
gtk/gtkhbox.c
gtk/gtkhpaned.c
gtk/gtkhruler.c
gtk/gtkhscale.c
gtk/gtkhscrollbar.c
gtk/gtkhseparator.c
gtk/gtkimage.c
gtk/gtkinputdialog.c
gtk/gtkinvisible.c
gtk/gtkitem.c
gtk/gtkitemfactory.c
gtk/gtklabel.c
gtk/gtklayout.c
gtk/gtklist.c
gtk/gtklistitem.c
gtk/gtkmain.c
gtk/gtkmenu.c
gtk/gtkmenubar.c
gtk/gtkmenuitem.c
gtk/gtkmenushell.c
gtk/gtkmisc.c
gtk/gtknotebook.c
gtk/gtkobject.c
gtk/gtkoptionmenu.c
gtk/gtkpacker.c
gtk/gtkpaned.c
gtk/gtkpixmap.c
gtk/gtkplug.c
gtk/gtkpreview.c
gtk/gtkprogress.c
gtk/gtkprogressbar.c
gtk/gtkradiobutton.c
gtk/gtkradiomenuitem.c
gtk/gtkrange.c
gtk/gtkrc.c
gtk/gtkruler.c
gtk/gtkscale.c
gtk/gtkscrollbar.c
gtk/gtkscrolledwindow.c
gtk/gtkseparator.c
gtk/gtksocket.c
gtk/gtkspinbutton.c
gtk/gtkstatusbar.c
gtk/gtkstyle.c
gtk/gtktable.c
gtk/gtktearoffmenuitem.c
gtk/gtktext.c
gtk/gtktipsquery.c
gtk/gtktogglebutton.c
gtk/gtktoolbar.c
gtk/gtktooltips.c
gtk/gtktree.c
gtk/gtktreeitem.c
gtk/gtktypeutils.c
gtk/gtktypeutils.h
gtk/gtkvbbox.c
gtk/gtkvbox.c
gtk/gtkviewport.c
gtk/gtkvpaned.c
gtk/gtkvruler.c
gtk/gtkvscale.c
gtk/gtkvscrollbar.c
gtk/gtkvseparator.c
gtk/gtkwidget.c
gtk/gtkwindow.c
gtk/makeenums.pl

index f1e5b7bb5f4aa4cc82a211d173e159db8a141ab2..085321de5bece627e54fdc5e525c86b02ff4f46d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>
+
+       * {gdk,gtk}/*.c: Make read-only data structures "static const" to
+       allow them to be shared, mainly including (but not limited to) the
+       GtkTypeInfo structures for each class.
+
+       * gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
+
 Mon Nov 30 12:17:10 1998  Jeff Garzik  <jgarzik@pobox.com>
 
        * gtk/gtknotebook.c (gtk_notebook_reorder_child):
index f1e5b7bb5f4aa4cc82a211d173e159db8a141ab2..085321de5bece627e54fdc5e525c86b02ff4f46d 100644 (file)
@@ -1,3 +1,11 @@
+1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>
+
+       * {gdk,gtk}/*.c: Make read-only data structures "static const" to
+       allow them to be shared, mainly including (but not limited to) the
+       GtkTypeInfo structures for each class.
+
+       * gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
+
 Mon Nov 30 12:17:10 1998  Jeff Garzik  <jgarzik@pobox.com>
 
        * gtk/gtknotebook.c (gtk_notebook_reorder_child):
index f1e5b7bb5f4aa4cc82a211d173e159db8a141ab2..085321de5bece627e54fdc5e525c86b02ff4f46d 100644 (file)
@@ -1,3 +1,11 @@
+1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>
+
+       * {gdk,gtk}/*.c: Make read-only data structures "static const" to
+       allow them to be shared, mainly including (but not limited to) the
+       GtkTypeInfo structures for each class.
+
+       * gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
+
 Mon Nov 30 12:17:10 1998  Jeff Garzik  <jgarzik@pobox.com>
 
        * gtk/gtknotebook.c (gtk_notebook_reorder_child):
index f1e5b7bb5f4aa4cc82a211d173e159db8a141ab2..085321de5bece627e54fdc5e525c86b02ff4f46d 100644 (file)
@@ -1,3 +1,11 @@
+1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>
+
+       * {gdk,gtk}/*.c: Make read-only data structures "static const" to
+       allow them to be shared, mainly including (but not limited to) the
+       GtkTypeInfo structures for each class.
+
+       * gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
+
 Mon Nov 30 12:17:10 1998  Jeff Garzik  <jgarzik@pobox.com>
 
        * gtk/gtknotebook.c (gtk_notebook_reorder_child):
index f1e5b7bb5f4aa4cc82a211d173e159db8a141ab2..085321de5bece627e54fdc5e525c86b02ff4f46d 100644 (file)
@@ -1,3 +1,11 @@
+1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>
+
+       * {gdk,gtk}/*.c: Make read-only data structures "static const" to
+       allow them to be shared, mainly including (but not limited to) the
+       GtkTypeInfo structures for each class.
+
+       * gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
+
 Mon Nov 30 12:17:10 1998  Jeff Garzik  <jgarzik@pobox.com>
 
        * gtk/gtknotebook.c (gtk_notebook_reorder_child):
index f1e5b7bb5f4aa4cc82a211d173e159db8a141ab2..085321de5bece627e54fdc5e525c86b02ff4f46d 100644 (file)
@@ -1,3 +1,11 @@
+1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>
+
+       * {gdk,gtk}/*.c: Make read-only data structures "static const" to
+       allow them to be shared, mainly including (but not limited to) the
+       GtkTypeInfo structures for each class.
+
+       * gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
+
 Mon Nov 30 12:17:10 1998  Jeff Garzik  <jgarzik@pobox.com>
 
        * gtk/gtknotebook.c (gtk_notebook_reorder_child):
index f1e5b7bb5f4aa4cc82a211d173e159db8a141ab2..085321de5bece627e54fdc5e525c86b02ff4f46d 100644 (file)
@@ -1,3 +1,11 @@
+1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>
+
+       * {gdk,gtk}/*.c: Make read-only data structures "static const" to
+       allow them to be shared, mainly including (but not limited to) the
+       GtkTypeInfo structures for each class.
+
+       * gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
+
 Mon Nov 30 12:17:10 1998  Jeff Garzik  <jgarzik@pobox.com>
 
        * gtk/gtknotebook.c (gtk_notebook_reorder_child):
index 36e0fb1438b1acd1fa619bad70b6bd1833450259..f504ea313a840f671ea294e619c81ea08ebc7e51 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -229,7 +229,7 @@ static gulong base_id;
 static gint autorepeat;
 
 #ifdef G_ENABLE_DEBUG
-static GDebugKey gdk_debug_keys[] = {
+static const GDebugKey gdk_debug_keys[] = {
   {"events",       GDK_DEBUG_EVENTS},
   {"misc",         GDK_DEBUG_MISC},
   {"dnd",          GDK_DEBUG_DND},
@@ -1504,8 +1504,8 @@ gdk_pointer_grab (GdkWindow *       window,
                  guint32         time)
 {
   /*  From gdkwindow.c */
-  extern int nevent_masks;
-  extern int event_mask_table[];
+  extern const int nevent_masks;
+  extern const int event_mask_table[];
   
   gint return_val;
   GdkWindowPrivate *window_private;
index c0f199fae98bb970a07a8c11fc995fdd5d6f62d0..a11da09f2236016115cc2e7db0248030b4b54cb5 100644 (file)
@@ -38,9 +38,9 @@ static GdkDevicePrivate *gdk_input_find_device (guint32 id);
 
 /* Incorporate the specific routines depending on compilation options */
 
-static GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
+static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
 
-static GdkDeviceInfo gdk_input_core_info =
+static const GdkDeviceInfo gdk_input_core_info =
 {
   GDK_CORE_POINTER,
   "Core Pointer",
index ad124457a85244c23a54d111480f98bd997cbed0..818b29f3dfa3eb4f196a679639a63af791fff6fa 100644 (file)
@@ -304,7 +304,7 @@ gdk_rgb_try_colormap (gint nr, gint ng, gint nb)
 static gboolean
 gdk_rgb_do_colormaps (void)
 {
-  const gint sizes[][3] = {
+  static const gint sizes[][3] = {
     /*    { 6, 7, 6 }, */
     { 6, 6, 6 }, 
     { 6, 6, 5 }, 
@@ -316,7 +316,7 @@ gdk_rgb_do_colormaps (void)
     { 3, 3, 3 }, 
     { 2, 2, 2 }
   };
-  const gint n_sizes = sizeof(sizes) / (3 * sizeof(gint));
+  static const gint n_sizes = sizeof(sizes) / (3 * sizeof(gint));
   gint i;
 
   for (i = 0; i < n_sizes; i++)
@@ -387,7 +387,7 @@ static guint32
 gdk_rgb_score_visual (GdkVisual *visual)
 {
   guint32 quality, speed, sys, pseudo;
-  gchar* visual_names[] =
+  static const gchar* visual_names[] =
   {
     "static gray",
     "grayscale",
@@ -535,7 +535,7 @@ void
 gdk_rgb_init (void)
 {
   gint i;
-  gint byte_order[1] = { 1 };
+  static const gint byte_order[1] = { 1 };
 
   /* check endian sanity */
 #if G_BYTE_ORDER == G_BIG_ENDIAN
@@ -982,7 +982,7 @@ static const guchar DM[128][128] =
 #define DM_WIDTH 8
 #define DM_WIDTH_SHIFT 3
 #define DM_HEIGHT 8
-static guchar DM[8][8] =
+static const guchar DM[8][8] =
 {
   { 0,  32, 8,  40, 2,  34, 10, 42 },
   { 48, 16, 56, 24, 50, 18, 58, 26 },
index 693020ef6190cee7e1ca8481138f4a5cf9b405a9..ebdcccb127b99a53566e06a6705fad0199e14e1e 100644 (file)
@@ -44,7 +44,7 @@ static gint navailable_types;
 
 #ifdef G_ENABLE_DEBUG
 
-static gchar* visual_names[] =
+static const gchar* visual_names[] =
 {
   "static gray",
   "grayscale",
@@ -61,8 +61,8 @@ static GHashTable *visual_hash = NULL;
 void
 gdk_visual_init (void)
 {
-  static gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
-  static GdkVisualType possible_types[6] =
+  static const gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
+  static const GdkVisualType possible_types[6] =
     {
       GDK_VISUAL_DIRECT_COLOR,
       GDK_VISUAL_TRUE_COLOR,
@@ -72,8 +72,8 @@ gdk_visual_init (void)
       GDK_VISUAL_STATIC_GRAY
     };
 
-  static gint npossible_depths = 7;
-  static gint npossible_types = 6;
+  static const gint npossible_depths = sizeof(possible_depths)/sizeof(gint);
+  static const gint npossible_types = sizeof(possible_types)/sizeof(GdkVisualType);
 
   XVisualInfo *visual_list;
   XVisualInfo visual_template;
index 09399dcf1ac3833de862fe4425a5c0e3c7c21bc0..c8a42595ed6636883e136e35d838f49ea2bd6201 100644 (file)
@@ -33,8 +33,7 @@
 #include <X11/extensions/shape.h>
 #endif
 
-int nevent_masks = 20;
-int event_mask_table[20] =
+const int event_mask_table[20] =
 {
   ExposureMask,
   PointerMotionMask,
@@ -57,6 +56,7 @@ int event_mask_table[20] =
   0,                           /* PROXIMTY_OUT */
   SubstructureNotifyMask
 };
+const int nevent_masks = sizeof(event_mask_table)/sizeof(int);
 
 static gboolean gdk_window_have_shape_ext (void);
 
index c0f199fae98bb970a07a8c11fc995fdd5d6f62d0..a11da09f2236016115cc2e7db0248030b4b54cb5 100644 (file)
@@ -38,9 +38,9 @@ static GdkDevicePrivate *gdk_input_find_device (guint32 id);
 
 /* Incorporate the specific routines depending on compilation options */
 
-static GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
+static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
 
-static GdkDeviceInfo gdk_input_core_info =
+static const GdkDeviceInfo gdk_input_core_info =
 {
   GDK_CORE_POINTER,
   "Core Pointer",
index 36e0fb1438b1acd1fa619bad70b6bd1833450259..f504ea313a840f671ea294e619c81ea08ebc7e51 100644 (file)
@@ -229,7 +229,7 @@ static gulong base_id;
 static gint autorepeat;
 
 #ifdef G_ENABLE_DEBUG
-static GDebugKey gdk_debug_keys[] = {
+static const GDebugKey gdk_debug_keys[] = {
   {"events",       GDK_DEBUG_EVENTS},
   {"misc",         GDK_DEBUG_MISC},
   {"dnd",          GDK_DEBUG_DND},
@@ -1504,8 +1504,8 @@ gdk_pointer_grab (GdkWindow *       window,
                  guint32         time)
 {
   /*  From gdkwindow.c */
-  extern int nevent_masks;
-  extern int event_mask_table[];
+  extern const int nevent_masks;
+  extern const int event_mask_table[];
   
   gint return_val;
   GdkWindowPrivate *window_private;
index 693020ef6190cee7e1ca8481138f4a5cf9b405a9..ebdcccb127b99a53566e06a6705fad0199e14e1e 100644 (file)
@@ -44,7 +44,7 @@ static gint navailable_types;
 
 #ifdef G_ENABLE_DEBUG
 
-static gchar* visual_names[] =
+static const gchar* visual_names[] =
 {
   "static gray",
   "grayscale",
@@ -61,8 +61,8 @@ static GHashTable *visual_hash = NULL;
 void
 gdk_visual_init (void)
 {
-  static gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
-  static GdkVisualType possible_types[6] =
+  static const gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
+  static const GdkVisualType possible_types[6] =
     {
       GDK_VISUAL_DIRECT_COLOR,
       GDK_VISUAL_TRUE_COLOR,
@@ -72,8 +72,8 @@ gdk_visual_init (void)
       GDK_VISUAL_STATIC_GRAY
     };
 
-  static gint npossible_depths = 7;
-  static gint npossible_types = 6;
+  static const gint npossible_depths = sizeof(possible_depths)/sizeof(gint);
+  static const gint npossible_types = sizeof(possible_types)/sizeof(GdkVisualType);
 
   XVisualInfo *visual_list;
   XVisualInfo visual_template;
index 09399dcf1ac3833de862fe4425a5c0e3c7c21bc0..c8a42595ed6636883e136e35d838f49ea2bd6201 100644 (file)
@@ -33,8 +33,7 @@
 #include <X11/extensions/shape.h>
 #endif
 
-int nevent_masks = 20;
-int event_mask_table[20] =
+const int event_mask_table[20] =
 {
   ExposureMask,
   PointerMotionMask,
@@ -57,6 +56,7 @@ int event_mask_table[20] =
   0,                           /* PROXIMTY_OUT */
   SubstructureNotifyMask
 };
+const int nevent_masks = sizeof(event_mask_table)/sizeof(int);
 
 static gboolean gdk_window_have_shape_ext (void);
 
index 06d2cc37ffdab051ec8da138ac6345ab0701e6ee..f929912fbe9103eecdd5492ce6b48bd34222e880 100644 (file)
@@ -702,7 +702,7 @@ gboolean
 gtk_accelerator_valid (guint             keyval,
                       GdkModifierType    modifiers)
 {
-  guint invalid_accelerator_vals[] = {
+  static const guint invalid_accelerator_vals[] = {
     GDK_BackSpace, GDK_Delete, GDK_KP_Delete,
     GDK_Shift_L, GDK_Shift_R, GDK_Shift_Lock, GDK_Caps_Lock, GDK_ISO_Lock,
     GDK_Control_L, GDK_Control_R, GDK_Meta_L, GDK_Meta_R,
@@ -880,7 +880,7 @@ gtk_accelerator_parse (const gchar    *accelerator,
            }
          else if (len >= 6 && is_modx (accelerator))
            {
-             guint mod_vals[] = {
+             static const guint mod_vals[] = {
                GDK_MOD1_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK,
                GDK_MOD4_MASK, GDK_MOD5_MASK
              };
index 11933d03e5d53e2023c4d26b82e9bff56898591a..e546d4c0b634f5f2fb9ea1bc483a5b050e6e08dd 100644 (file)
@@ -57,7 +57,7 @@ gtk_accel_label_get_type (void)
   
   if (!accel_label_type)
     {
-      GtkTypeInfo accel_label_info =
+      static const GtkTypeInfo accel_label_info =
       {
        "GtkAccelLabel",
        sizeof (GtkAccelLabel),
index 03c09c537ff8db230d0d23944ff5b94c9a5cd34f..b2c463c2d6d67f907948682033b9606c0eb4c8c6 100644 (file)
@@ -41,7 +41,7 @@ gtk_adjustment_get_type (void)
 
   if (!adjustment_type)
     {
-      GtkTypeInfo adjustment_info =
+      static const GtkTypeInfo adjustment_info =
       {
        "GtkAdjustment",
        sizeof (GtkAdjustment),
index 7f075861bf5126fa4462103e8a59ceb7954b9857..77e0656733747f16358a5f150ccb3f37f9e112e7 100644 (file)
@@ -50,7 +50,7 @@ gtk_alignment_get_type (void)
 
   if (!alignment_type)
     {
-      GtkTypeInfo alignment_info =
+      static const GtkTypeInfo alignment_info =
       {
        "GtkAlignment",
        sizeof (GtkAlignment),
index e70f649368cc860a8bc89353866c3c7dd962cad4..985618b775cb86df9e06b16645a075b0ef5718bb 100644 (file)
@@ -47,7 +47,7 @@ gtk_arrow_get_type (void)
 
   if (!arrow_type)
     {
-      GtkTypeInfo arrow_info =
+      static const GtkTypeInfo arrow_info =
       {
        "GtkArrow",
        sizeof (GtkArrow),
index 2472e8b2aa4737f18136963610089677acc9561d..ba017614c7fe1eb57500b443b7bc11231a440d63 100644 (file)
@@ -44,7 +44,7 @@ gtk_aspect_frame_get_type (void)
 
   if (!aspect_frame_type)
     {
-      GtkTypeInfo aspect_frame_info =
+      static const GtkTypeInfo aspect_frame_info =
       {
        "GtkAspectFrame",
        sizeof (GtkAspectFrame),
index 0c510095d28820e54bf647ef917952e710a7d649..18c8b17ff045aabe6a5a7eb76625c20051e4144c 100644 (file)
@@ -36,7 +36,7 @@ gtk_button_box_get_type (void)
 
   if (!button_box_type)
     {
-      GtkTypeInfo button_box_info =
+      static const GtkTypeInfo button_box_info =
       {
        "GtkButtonBox",
        sizeof (GtkButtonBox),
index feff474b6810f3f68fb78ca2b558b3a30a2f0510..30d60fbc34afaa6dd4ffb0f20d111176d9e43141 100644 (file)
@@ -48,7 +48,7 @@ gtk_bin_get_type (void)
 
   if (!bin_type)
     {
-      GtkTypeInfo bin_info =
+      static const GtkTypeInfo bin_info =
       {
        "GtkBin",
        sizeof (GtkBin),
index cfc06220f751122eed6d103e059c64d1da72ba09..77a5ce4e6e25790e2d7016ed5d5a1222c7b134b5 100644 (file)
@@ -76,7 +76,7 @@ gtk_box_get_type (void)
 
   if (!box_type)
     {
-      GtkTypeInfo box_info =
+      static const GtkTypeInfo box_info =
       {
        "GtkBox",
        sizeof (GtkBox),
index 7ea658af2c1134e394b0ef0e658076d4cef552a7..fcc6cca46a8792e1a6c0f7c27a2170acc40fb44d 100644 (file)
@@ -100,7 +100,7 @@ gtk_button_get_type (void)
 
   if (!button_type)
     {
-      GtkTypeInfo button_info =
+      static const GtkTypeInfo button_info =
       {
        "GtkButton",
        sizeof (GtkButton),
index 078618f53d051a6b92a6d223d897dd5c44b59a4b..33147b3b89a12927bb95ecfb964946179c6fdf79 100644 (file)
@@ -43,13 +43,13 @@ typedef enum { false = FALSE , true = TRUE } boolean;
 #define and        &&      /* logical (boolean) operators: lower case */
 #define or         ||
 
-static N_int month_length[2][13] =
+static const N_int month_length[2][13] =
 {
   { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
   { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
 };
 
-static N_int days_in_months[2][14] =
+static const N_int days_in_months[2][14] =
 {
   { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
   { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
@@ -313,7 +313,7 @@ gtk_calendar_get_type (void)
   
   if (!calendar_type)
     {
-      GtkTypeInfo calendar_info =
+      static const GtkTypeInfo calendar_info =
       {
        "GtkCalendar",
        sizeof (GtkCalendar),
index 3560b422d586eb69f0c1ce254a12d98ec26dd399..c064cf0a9263ab71ffd99a87cbf5c81c776ecda5 100644 (file)
@@ -52,7 +52,7 @@ gtk_check_button_get_type (void)
 
   if (!check_button_type)
     {
-      GtkTypeInfo check_button_info =
+      static const GtkTypeInfo check_button_info =
       {
        "GtkCheckButton",
        sizeof (GtkCheckButton),
index 6db3c8040f1fef1ec69f5854fcf2cf58b47ae918..71feaa59c45c0db4e72ad62592656ba367aaefba 100644 (file)
@@ -54,7 +54,7 @@ gtk_check_menu_item_get_type (void)
 
   if (!check_menu_item_type)
     {
-      GtkTypeInfo check_menu_item_info =
+      static const GtkTypeInfo check_menu_item_info =
       {
         "GtkCheckMenuItem",
         sizeof (GtkCheckMenuItem),
index d54dc4c412b84b301ed0a15b7a80d0ea7b979f17..445964cc4c8641d6cf2d1c374a18557fdab09c92 100644 (file)
@@ -396,7 +396,7 @@ gtk_clist_get_type (void)
 
   if (!clist_type)
     {
-      GtkTypeInfo clist_info =
+      static const GtkTypeInfo clist_info =
       {
        "GtkCList",
        sizeof (GtkCList),
index 673a962e289274991f03fbee0f7c86eda6875101..894f3b86dbc984ff06483c1fff2ca31a97b40406 100644 (file)
@@ -196,7 +196,7 @@ static const gchar  *value_index_key = "gtk-value-index";
 #define SF GtkSignalFunc
 
 
-scale_val_type scale_vals[NUM_CHANNELS] =
+static const scale_val_type scale_vals[NUM_CHANNELS] =
 {
   {"Hue:",        0.0, 360.0, 1.00, 10.00, (SF) gtk_color_selection_hsv_updater},
   {"Saturation:", 0.0,   1.0, 0.01,  0.01, (SF) gtk_color_selection_hsv_updater},
@@ -214,7 +214,7 @@ gtk_color_selection_get_type (void)
 
   if (!color_selection_type)
     {
-      GtkTypeInfo colorsel_info =
+      static const GtkTypeInfo colorsel_info =
       {
        "GtkColorSelection",
        sizeof (GtkColorSelection),
@@ -517,7 +517,7 @@ gtk_color_selection_realize (GtkWidget         *widget)
 {
   GtkColorSelection *colorsel;
 
-  GtkTargetEntry targets[] = {
+  static const GtkTargetEntry targets[] = {
     { "application/x-color", 0 }
   };
 
index 4bd9604f98acb29cf4e36e3054754bfb38f5914a..f26f0a59cbab03d064c4c08ec26c664330304bf8 100644 (file)
@@ -725,7 +725,7 @@ gtk_combo_get_type (void)
 
   if (!combo_type)
     {
-      GtkTypeInfo combo_info =
+      static const GtkTypeInfo combo_info =
       {
        "GtkCombo",
        sizeof (GtkCombo),
index 74bbaeca828f8a327237a6381aad6211fec33a1e..b42358b2f9595b8315eb90bd4f44fda53e9a0b73 100644 (file)
@@ -112,7 +112,7 @@ gtk_container_get_type (void)
 
   if (!container_type)
     {
-      GtkTypeInfo container_info =
+      static const GtkTypeInfo container_info =
       {
        "GtkContainer",
        sizeof (GtkContainer),
index 6c4d9d90512a1718972a38154ee92719e423f921..6750279aec8f290f3ed76599fef3b49bd5aaa1e9 100644 (file)
@@ -298,7 +298,7 @@ gtk_ctree_get_type (void)
 
   if (!ctree_type)
     {
-      GtkTypeInfo ctree_info =
+      static const GtkTypeInfo ctree_info =
       {
        "GtkCTree",
        sizeof (GtkCTree),
index 36442e1303e1f13adbb9f4b29311da5cf8354197..8a760ebb011a9f77eb66ff70c8c8f8e1ccc68374 100644 (file)
@@ -58,7 +58,7 @@ gtk_curve_get_type (void)
 
   if (!curve_type)
     {
-      GtkTypeInfo curve_info =
+      static const GtkTypeInfo curve_info =
       {
        "GtkCurve",
        sizeof (GtkCurve),
index c268abeb600f872033e2723fa41569f617923d90..b9030ed9ffb9be410351a78e3bdf7c9686fa779e 100644 (file)
@@ -39,7 +39,7 @@ gtk_data_get_type (void)
 
   if (!data_type)
     {
-      GtkTypeInfo data_info =
+      static const GtkTypeInfo data_info =
       {
        "GtkData",
        sizeof (GtkData),
index 81b3e394c0804b4a5ac6c36ce360673e7c497e1e..f3b8ca82225c8cdb4391ebb0584c7a3b1fa4c1c7 100644 (file)
@@ -34,7 +34,7 @@ gtk_dialog_get_type (void)
 
   if (!dialog_type)
     {
-      GtkTypeInfo dialog_info =
+      static const GtkTypeInfo dialog_info =
       {
        "GtkDialog",
        sizeof (GtkDialog),
index d4400b3d9c77a3d9b36b6513be2377077f4f6f12..cecf799ef24e241c6ad98487b967f517d01e42a7 100644 (file)
@@ -302,10 +302,10 @@ static struct {
   { 0              ,  action_none_bits, action_none_mask_bits, NULL },
 };
 
-static gint n_drag_cursors = sizeof(drag_cursors) / sizeof(drag_cursors[0]);
+static const gint n_drag_cursors = sizeof(drag_cursors) / sizeof(drag_cursors[0]);
 
 /* XPM */
-static char * drag_default_xpm[] = {
+static const char * drag_default_xpm[] = {
 "32 32 3 1",
 "      c None",
 ".     c #000000",
index 3a67328764afb579aa2229a8a77087053775491e..1bdb8560e649a75fc8ae2826acfd94840256a814 100644 (file)
@@ -34,7 +34,7 @@ gtk_drawing_area_get_type (void)
 
   if (!drawing_area_type)
     {
-      GtkTypeInfo drawing_area_info =
+      static const GtkTypeInfo drawing_area_info =
       {
        "GtkDrawingArea",
        sizeof (GtkDrawingArea),
index b8df2a4d56c0929aade23fa943646efa37988c6e..317aae0cfea82bfff827e90ccdeaf7d38181dc6b 100644 (file)
@@ -33,7 +33,7 @@ gtk_draw_window_get_type (void)
 
   if (!draw_window_type)
     {
-      GtkTypeInfo draw_window_info =
+      static const GtkTypeInfo draw_window_info =
       {
        "GtkDrawWindow",
        sizeof (GtkDrawWindow),
index e720395676fdf934f835842cdee024376d635212..533527487638d6525015f647ed5ec8a1c24c7264 100644 (file)
@@ -109,7 +109,7 @@ gtk_editable_get_type (void)
 
   if (!editable_type)
     {
-      GtkTypeInfo editable_info =
+      static const GtkTypeInfo editable_info =
       {
        "GtkEditable",
        sizeof (GtkEditable),
@@ -371,12 +371,12 @@ gtk_editable_get_arg (GtkObject      *object,
 static void
 gtk_editable_init (GtkEditable *editable)
 {
-  static GtkTargetEntry targets[] = {
+  static const GtkTargetEntry targets[] = {
     { "STRING", TARGET_STRING },
     { "TEXT",   TARGET_TEXT }, 
     { "COMPOUND_TEXT", TARGET_COMPOUND_TEXT }
   };
-  static gint n_targets = sizeof(targets) / sizeof(targets[0]);
+  static const gint n_targets = sizeof(targets) / sizeof(targets[0]);
   
   GTK_WIDGET_SET_FLAGS (editable, GTK_CAN_FOCUS);
 
index 847fb30378a5724e5d765f0bc6152e1a828582e6..77079d2ae4122b07e0cafee3d6564ffda3ef38ac 100644 (file)
@@ -153,7 +153,7 @@ static void gtk_entry_set_position_from_editable (GtkEditable *editable,
 static GtkWidgetClass *parent_class = NULL;
 static GdkAtom ctext_atom = GDK_NONE;
 
-static GtkTextFunction control_keys[26] =
+static const GtkTextFunction control_keys[26] =
 {
   (GtkTextFunction)gtk_move_beginning_of_line,    /* a */
   (GtkTextFunction)gtk_move_backward_character,   /* b */
@@ -183,7 +183,7 @@ static GtkTextFunction control_keys[26] =
   NULL,                                           /* z */
 };
 
-static GtkTextFunction alt_keys[26] =
+static const GtkTextFunction alt_keys[26] =
 {
   NULL,                                           /* a */
   (GtkTextFunction)gtk_move_backward_word,        /* b */
@@ -221,7 +221,7 @@ gtk_entry_get_type (void)
 
   if (!entry_type)
     {
-      GtkTypeInfo entry_info =
+      static const GtkTypeInfo entry_info =
       {
        "GtkEntry",
        sizeof (GtkEntry),
index 8cb5000116018b3aa5997dd97c5a7c01b78d2554..c4dccd925a0977d125f3272b176e312d1302d5d6 100644 (file)
@@ -40,7 +40,7 @@ gtk_event_box_get_type (void)
 
   if (!event_box_type)
     {
-      GtkTypeInfo event_box_info =
+      static const GtkTypeInfo event_box_info =
       {
        "GtkEventBox",
        sizeof (GtkEventBox),
index cd35e14b8dc4b7e5b91c9adf2ac9c0eb95c42158..26bc7da030d06f1ac69b10199c98bf726ece4880 100644 (file)
@@ -329,7 +329,7 @@ gtk_file_selection_get_type (void)
 
   if (!file_selection_type)
     {
-      GtkTypeInfo filesel_info =
+      static const GtkTypeInfo filesel_info =
       {
        "GtkFileSelection",
        sizeof (GtkFileSelection),
@@ -369,8 +369,8 @@ gtk_file_selection_init (GtkFileSelection *filesel)
   GtkWidget *pulldown_hbox;
   GtkWidget *scrolled_win;
 
-  char *dir_title [] = { "Directories", };
-  char *file_title [] = { "Files", };
+  static const char *dir_title [] = { "Directories", NULL };
+  static const char *file_title [] = { "Files", NULL };
   
   filesel->cmpl_state = cmpl_init_state ();
 
@@ -2026,15 +2026,16 @@ check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs)
    * expensive.
    */
 
-  static struct {
+  static const struct {
     gchar *name;
     gboolean present;
     struct stat statbuf;
   } no_stat_dirs[] = {
     { "/afs", FALSE, { 0 } },
+    { "/net", FALSE, { 0 } }
   };
 
-  static gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]);
+  static const gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]);
   static gboolean initialized = FALSE;
 
   gint i;
index e2b98692924aac4bf5ebbc18748246e1a00751c1..8e51bb2e620039bca0f5cde95604886585ba7632 100644 (file)
@@ -54,7 +54,7 @@ gtk_fixed_get_type (void)
 
   if (!fixed_type)
     {
-      GtkTypeInfo fixed_info =
+      static const GtkTypeInfo fixed_info =
       {
        "GtkFixed",
        sizeof (GtkFixed),
index 7deff314658f5f302d5421bfed519cc49cec5799..7c193d3538668cfb38dbb1de49d635052d836f0c 100644 (file)
@@ -93,7 +93,7 @@
 /* These are what we use as the standard font sizes, for the size clist.
    Note that when using points we still show these integer point values but
    we work internally in decipoints (and decipoint values can be typed in). */
-static guint16 font_sizes[] = {
+static const guint16 font_sizes[] = {
   8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 24, 26, 28,
   32, 36, 40, 48, 56, 64, 72
 };
@@ -198,7 +198,7 @@ typedef enum
 } FontField;
 
 /* These are the names of the fields, used on the info & filter page. */
-static gchar* xlfd_field_names[GTK_XLFD_NUM_FIELDS] = {
+static const gchar* xlfd_field_names[GTK_XLFD_NUM_FIELDS] = {
   "Foundry:",
   "Family:",
   "Weight:",
@@ -228,7 +228,7 @@ typedef enum
 
 /* This is used to look up a field in a fontname given one of the above
    property indices. */
-static FontField xlfd_index[GTK_NUM_FONT_PROPERTIES] = {
+static const FontField xlfd_index[GTK_NUM_FONT_PROPERTIES] = {
   XLFD_WEIGHT,
   XLFD_SLANT,
   XLFD_SET_WIDTH,
@@ -238,10 +238,10 @@ static FontField xlfd_index[GTK_NUM_FONT_PROPERTIES] = {
 };
 
 /* These are the positions of the properties in the filter table - x, y. */
-static gint filter_positions[GTK_NUM_FONT_PROPERTIES][2] = {
+static const gint filter_positions[GTK_NUM_FONT_PROPERTIES][2] = {
   { 1, 0 }, { 0, 2 }, { 1, 2 }, { 2, 2 }, { 2, 0 }, { 0, 0 }
 };
-static gint filter_heights[GTK_NUM_FONT_PROPERTIES] = {
+static const gint filter_heights[GTK_NUM_FONT_PROPERTIES] = {
   100, 70, 70, 40, 100, 100
 };
 
@@ -396,7 +396,7 @@ gtk_font_selection_get_type()
   
   if(!font_selection_type)
     {
-      GtkTypeInfo fontsel_type_info =
+      static const GtkTypeInfo fontsel_type_info =
       {
        "GtkFontSelection",
        sizeof (GtkFontSelection),
index f817e31b4498a183120042568e0f5a643bd161ca..5831382da630e6111a86725cc6edcec7b341847e 100644 (file)
@@ -61,7 +61,7 @@ gtk_frame_get_type (void)
 
   if (!frame_type)
     {
-      GtkTypeInfo frame_info =
+      static const GtkTypeInfo frame_info =
       {
        "GtkFrame",
        sizeof (GtkFrame),
index 787de5a428eb795526fb9b5af5427e48ea8724ca..9a1c62b3aff3bdca344f8e9a195568a423035349 100644 (file)
@@ -58,7 +58,7 @@ enum
     NUM_XPMS
   };
 
-static char *xpm[][27] =
+static const char *xpm[][27] =
   {
     /* spline: */
     {
@@ -209,7 +209,7 @@ gtk_gamma_curve_get_type (void)
 
   if (!gamma_curve_type)
     {
-      GtkTypeInfo gamma_curve_info =
+      static const GtkTypeInfo gamma_curve_info =
       {
        "GtkGammaCurve",
        sizeof (GtkGammaCurve),
index efc4ad6ca9a82da241160c164c582409fbbb781a..e39be04d48ad583f30438039e5ee970dc946189a 100644 (file)
@@ -92,7 +92,7 @@ gtk_handle_box_get_type (void)
 
   if (!handle_box_type)
     {
-      GtkTypeInfo handle_box_info =
+      static const GtkTypeInfo handle_box_info =
       {
        "GtkHandleBox",
        sizeof (GtkHandleBox),
index 4b9afe1ad4ef87e30796ecd7dd5af434189fa05c..a2934de1e91704ceb72b753ca7ce4453658eb207 100644 (file)
@@ -37,7 +37,7 @@ gtk_hbutton_box_get_type (void)
 
   if (!hbutton_box_type)
     {
-      GtkTypeInfo hbutton_box_info =
+      static const GtkTypeInfo hbutton_box_info =
       {
        "GtkHButtonBox",
        sizeof (GtkHButtonBox),
index 0dbc25801939637198656681466fb4fc09dd1925..6c3db7484918b2b87e803df1032eca440f9984b7 100644 (file)
@@ -34,7 +34,7 @@ gtk_hbox_get_type (void)
 
   if (!hbox_type)
     {
-      GtkTypeInfo hbox_info =
+      static const GtkTypeInfo hbox_info =
       {
        "GtkHBox",
        sizeof (GtkHBox),
index 4312575f82329f6ec38c43d9e93e2a50420f8ea6..eec7581627c83204c7df5be8da1eb911d9da42aa 100644 (file)
@@ -43,7 +43,7 @@ gtk_hpaned_get_type (void)
 
   if (!hpaned_type)
     {
-      GtkTypeInfo hpaned_info =
+      static const GtkTypeInfo hpaned_info =
       {
        "GtkHPaned",
        sizeof (GtkHPaned),
index 40af247119424766d2a333d6fb9f5859ea0f3c00..5981b8dce9bece54f4670e977affa8f7661c9cc6 100644 (file)
@@ -45,7 +45,7 @@ gtk_hruler_get_type (void)
 
   if (!hruler_type)
     {
-      GtkTypeInfo hruler_info =
+      static const GtkTypeInfo hruler_info =
       {
        "GtkHRuler",
        sizeof (GtkHRuler),
index 13e82dc862020b693594ef2fe2d2d920fe5d0bf0..42b7721c1ab457c9b4474861226bb944e873c3a7 100644 (file)
@@ -70,7 +70,7 @@ gtk_hscale_get_type (void)
   
   if (!hscale_type)
     {
-      GtkTypeInfo hscale_info =
+      static const GtkTypeInfo hscale_info =
       {
         "GtkHScale",
         sizeof (GtkHScale),
index 71dac16648c999d2ddd65fc16e9bfbad858927e9..cf7c6650b80c516a97e253813b6525d108a14ad7 100644 (file)
@@ -58,7 +58,7 @@ gtk_hscrollbar_get_type (void)
   
   if (!hscrollbar_type)
     {
-      GtkTypeInfo hscrollbar_info =
+      static const GtkTypeInfo hscrollbar_info =
       {
         "GtkHScrollbar",
         sizeof (GtkHScrollbar),
index 16b5908a270f1535d0ba912de6b004f1f2844091..3d0c4fd7f608b530f51904f87496f6af706cd12d 100644 (file)
@@ -32,7 +32,7 @@ gtk_hseparator_get_type (void)
 
   if (!hseparator_type)
     {
-      GtkTypeInfo hseparator_info =
+      static const GtkTypeInfo hseparator_info =
       {
        "GtkHSeparator",
        sizeof (GtkHSeparator),
index 9b26aafb2f1f462ad0e6f24bafa9f4f1507b79eb..20b6f499584a66aed47708c3addccbf51152b227 100644 (file)
@@ -33,7 +33,7 @@ gtk_image_get_type (void)
 
   if (!image_type)
     {
-      GtkTypeInfo image_info =
+      static const GtkTypeInfo image_info =
       {
        "GtkImage",
        sizeof (GtkImage),
index bf1aa3d285861de2e4653063431543efc7054cf3..0d68b2b1c50644a27be8c5991fa68890d204f7c0 100644 (file)
@@ -114,7 +114,7 @@ gtk_input_dialog_get_type (void)
 
   if (!input_dialog_type)
     {
-      GtkTypeInfo input_dialog_info =
+      static const GtkTypeInfo input_dialog_info =
       {
        "GtkInputDialog",
        sizeof (GtkInputDialog),
@@ -484,7 +484,7 @@ gtk_input_dialog_set_axis(GtkWidget *widget, gpointer data)
 static void
 gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDeviceInfo *info)
 {
-  static char *axis_use_strings[GDK_AXIS_LAST] =
+  static const char *axis_use_strings[GDK_AXIS_LAST] =
   {
     "",
     "X",
index 8233184e75f4be54647dc3276fdaaeb1dbcaf639..e0b6744ce32c8a918461f71e5d34cd00df9d8634 100644 (file)
@@ -33,7 +33,7 @@ gtk_invisible_get_type (void)
 
   if (!invisible_type)
     {
-      GtkTypeInfo invisible_info =
+      static const GtkTypeInfo invisible_info =
       {
        "GtkInvisible",
        sizeof (GtkInvisible),
index 96132634420b93fde399c5085745f89da5e09fe3..febdff8a773234eb0ed9d2f76c6aa6cb342eae5b 100644 (file)
@@ -49,7 +49,7 @@ gtk_item_get_type (void)
 
   if (!item_type)
     {
-      GtkTypeInfo item_info =
+      static const GtkTypeInfo item_info =
       {
        "GtkItem",
        sizeof (GtkItem),
index 60377a4b234b055ac76255baffb40fead8da5768..009ec5d3b3eb6c83c0b82181a48a9f8820565d47 100644 (file)
@@ -158,7 +158,7 @@ gtk_item_factory_get_type (void)
   
   if (!item_factory_type)
     {
-      GtkTypeInfo item_factory_info =
+      static const GtkTypeInfo item_factory_info =
       {
        "GtkItemFactory",
        sizeof (GtkItemFactory),
index 18a167712eade8574efc62e300cce3ebc8225a8e..ff97c508fbbb78a43d1112328f398ff78c4db2d3 100644 (file)
@@ -64,7 +64,7 @@ gtk_label_get_type (void)
   
   if (!label_type)
     {
-      GtkTypeInfo label_info =
+      static const GtkTypeInfo label_info =
       {
        "GtkLabel",
        sizeof (GtkLabel),
index 2ca7a12e5c0392bf43ce3cf16ba7b864bf379a19..4702f9b33ffc8d73c2c5944b58efed261f8b2d5b 100644 (file)
@@ -305,7 +305,7 @@ gtk_layout_get_type (void)
 
   if (!layout_type)
     {
-      GtkTypeInfo layout_info =
+      static const GtkTypeInfo layout_info =
       {
        "GtkLayout",
        sizeof (GtkLayout),
index 8795dbb156dd51c6911d489ea934cf19cf9258cb..e7a9bc8393043b0c51b8e7e9c6c248dc4a66befa 100644 (file)
@@ -154,7 +154,7 @@ gtk_list_get_type (void)
 
   if (!list_type)
     {
-      GtkTypeInfo list_info =
+      static const GtkTypeInfo list_info =
       {
        "GtkList",
        sizeof (GtkList),
index b5837798265744a991424118198b52a53ee36c00..69be352a90331e6541917c5edcf5cb2c6589f52f 100644 (file)
@@ -74,7 +74,7 @@ gtk_list_item_get_type (void)
 
   if (!list_item_type)
     {
-      GtkTypeInfo list_item_info =
+      static const GtkTypeInfo list_item_info =
       {
        "GtkListItem",
        sizeof (GtkListItem),
index f6245debb738f4703f100e12a49d8ab57d032ee2..eb3b5e630c81b1d39eb16cc9f87b450458287897 100644 (file)
@@ -216,7 +216,7 @@ static GdkColormap *gtk_colormap;      /* The colormap to be used in creating new
 guint gtk_debug_flags = 0;                /* Global GTK debug flag */
 
 #ifdef G_ENABLE_DEBUG
-static GDebugKey gtk_debug_keys[] = {
+static const GDebugKey gtk_debug_keys[] = {
   {"objects", GTK_DEBUG_OBJECTS},
   {"misc", GTK_DEBUG_MISC},
   {"signals", GTK_DEBUG_SIGNALS},
index 663c7c7405e904f79e0304646c2cb9a19f31dbe9..72932b17c8a6e0c1bc56a5182e5d42ccc8737740 100644 (file)
@@ -75,7 +75,7 @@ gtk_menu_get_type (void)
   
   if (!menu_type)
     {
-      GtkTypeInfo menu_info =
+      static const GtkTypeInfo menu_info =
       {
        "GtkMenu",
        sizeof (GtkMenu),
index d22ba4fdfe515cc47d3db55475d62740924af0ea..e79e9ebe176477a120bf2b15791a8940092a9849 100644 (file)
@@ -59,7 +59,7 @@ gtk_menu_bar_get_type (void)
 
   if (!menu_bar_type)
     {
-      GtkTypeInfo menu_bar_info =
+      static const GtkTypeInfo menu_bar_info =
       {
        "GtkMenuBar",
        sizeof (GtkMenuBar),
index 76611e98ee02ff2497d7edb4a94de15e10e08f36..cec8e3f14763d1fe8770778aea35146c96d61c96 100644 (file)
@@ -77,7 +77,7 @@ gtk_menu_item_get_type (void)
 
   if (!menu_item_type)
     {
-      GtkTypeInfo menu_item_info =
+      static const GtkTypeInfo menu_item_info =
       {
        "GtkMenuItem",
        sizeof (GtkMenuItem),
index ad909662116228f4fbbda87acd43fe73a891e4b3..e6883aa0890b14819f3f4385c8734026112a8c1e 100644 (file)
@@ -147,7 +147,7 @@ gtk_menu_shell_get_type (void)
 
   if (!menu_shell_type)
     {
-      GtkTypeInfo menu_shell_info =
+      static const GtkTypeInfo menu_shell_info =
       {
        "GtkMenuShell",
        sizeof (GtkMenuShell),
index 6e235df23d304834c5c7e8cbaaa132c0b13aabde..0b984c3ccd00774a38d8872f420e19678b671c41 100644 (file)
@@ -46,7 +46,7 @@ gtk_misc_get_type (void)
 
   if (!misc_type)
     {
-      GtkTypeInfo misc_info =
+      static const GtkTypeInfo misc_info =
       {
        "GtkMisc",
        sizeof (GtkMisc),
index 505ab837065340850fa610ec190d04b8e60becf8..0d566d6fa84d03e942a9156f8c62abbe4d617571 100644 (file)
@@ -210,7 +210,7 @@ gtk_notebook_get_type (void)
 
   if (!notebook_type)
     {
-      GtkTypeInfo notebook_info =
+      static const GtkTypeInfo notebook_info =
       {
        "GtkNotebook",
        sizeof (GtkNotebook),
index c8b7274282ecacd28877900dade699f039363247..aacdbfd12b81003cf352dc8bdf9b1f05a305d951 100644 (file)
@@ -96,8 +96,8 @@ gtk_object_debug (void)
 void
 gtk_object_init_type (void)
 {
-  GtkType object_type = 0;
-  GtkTypeInfo object_info =
+  static GtkType object_type = 0;
+  static const GtkTypeInfo object_info =
   {
     "GtkObject",
     sizeof (GtkObject),
index 3c6310e1690b681f1f448e5fa94a120403e543d8..9db0dfa8ffca4a79973e6d9535a622a355b13e82 100644 (file)
@@ -74,7 +74,7 @@ gtk_option_menu_get_type (void)
 
   if (!option_menu_type)
     {
-      GtkTypeInfo option_menu_info =
+      static const GtkTypeInfo option_menu_info =
       {
        "GtkOptionMenu",
        sizeof (GtkOptionMenu),
index 3adc333851149094f11af7699f6add6a62e8cf42..2909f7c288bc6267a9ab0d8b3ebcb8fb9b7e1efc 100644 (file)
@@ -161,7 +161,7 @@ gtk_packer_get_type (void)
 
   if (!packer_type)
     {
-      GtkTypeInfo packer_info =
+      static const GtkTypeInfo packer_info =
       {
         "GtkPacker",
         sizeof (GtkPacker),
index dda82a3ca344d60a35a7de31f9ff06acc9d1a25a..d679982b80b667944acee0ba6c9a1721d1c1ab8d 100644 (file)
@@ -48,7 +48,7 @@ gtk_paned_get_type (void)
   
   if (!paned_type)
     {
-      GtkTypeInfo paned_info =
+      static const GtkTypeInfo paned_info =
       {
        "GtkPaned",
        sizeof (GtkPaned),
index e38bd8d8078021147f2cf78ebf6973bc2b392da3..f1e66253583899e7cef6a66188e75c2a5aaa6f62 100644 (file)
@@ -39,7 +39,7 @@ gtk_pixmap_get_type (void)
 
   if (!pixmap_type)
     {
-      GtkTypeInfo pixmap_info =
+      static const GtkTypeInfo pixmap_info =
       {
        "GtkPixmap",
        sizeof (GtkPixmap),
index 69431c82d80737d2d7fbd2ee45459bcac76a66b3..ba2e906486dc79cb04427670be8c402a83d3b585 100644 (file)
@@ -44,7 +44,7 @@ gtk_plug_get_type ()
 
   if (!plug_type)
     {
-      GtkTypeInfo plug_info =
+      static const GtkTypeInfo plug_info =
       {
        "GtkPlug",
        sizeof (GtkPlug),
index c3ebfabf8bbb8e669b9eec5d0abafc5c296d9014..05df6d98367687494e318f950b8e96c3342d57fb 100644 (file)
@@ -51,7 +51,7 @@ gtk_preview_get_type (void)
 
   if (!preview_type)
     {
-      GtkTypeInfo preview_info =
+      static const GtkTypeInfo preview_info =
       {
         "GtkPreview",
         sizeof (GtkPreview),
index ce9267d53e22376666578dcedfc4fd040ad4c4e3..cfd58957d2883a3b74768a46236fddd14bffd6e6 100644 (file)
@@ -62,7 +62,7 @@ gtk_progress_get_type (void)
 
   if (!progress_type)
     {
-      GtkTypeInfo progress_info =
+      static const GtkTypeInfo progress_info =
       {
        "GtkProgress",
        sizeof (GtkProgress),
index 50518adcf99bca2995c899226c94b9a37f0a6baf..43ab65c3f2617d8ee4ba5a91798c2e7c4eb6359f 100644 (file)
@@ -61,7 +61,7 @@ gtk_progress_bar_get_type (void)
 
   if (!progress_bar_type)
     {
-      GtkTypeInfo progress_bar_info =
+      static const GtkTypeInfo progress_bar_info =
       {
        "GtkProgressBar",
        sizeof (GtkProgressBar),
index 33c78e76eab01163210625ff5b69a79ad7fd8272..9ec83c4a6b1aec0c5ff37ef791efb6002249d40f 100644 (file)
@@ -53,7 +53,7 @@ gtk_radio_button_get_type (void)
 
   if (!radio_button_type)
     {
-      GtkTypeInfo radio_button_info =
+      static const GtkTypeInfo radio_button_info =
       {
        "GtkRadioButton",
        sizeof (GtkRadioButton),
index 482bcdd85d2f090fc7961e4f2e65a6e4dbeba5c5..7741453b03d272d36de3712d044eab80c37cf88e 100644 (file)
@@ -34,7 +34,7 @@ gtk_radio_menu_item_get_type (void)
 
   if (!radio_menu_item_type)
     {
-      GtkTypeInfo radio_menu_item_info =
+      static const GtkTypeInfo radio_menu_item_info =
       {
         "GtkRadioMenuItem",
         sizeof (GtkRadioMenuItem),
index 675e76bfe5d7c288cbe361ee40bd1e69848274d9..73bed02dde970b294602dcbff2ffb969f890dd76 100644 (file)
@@ -99,7 +99,7 @@ gtk_range_get_type (void)
 
   if (!range_type)
     {
-      GtkTypeInfo range_info =
+      static const GtkTypeInfo range_info =
       {
        "GtkRange",
        sizeof (GtkRange),
index a855ef22c1be7d71738d1ffdd22936b69a9bc6fc..3de06c5c2cf72b2641b7d0c12a39cf91a438c756 100644 (file)
@@ -97,7 +97,7 @@ static void        gtk_rc_append_default_module_path (void);
 static void        gtk_rc_append_pixmap_path         (gchar *dir);
 
 
-static GScannerConfig  gtk_rc_scanner_config =
+static const GScannerConfig    gtk_rc_scanner_config =
 {
   (
    " \t\n"
@@ -138,7 +138,7 @@ static      GScannerConfig  gtk_rc_scanner_config =
   FALSE                        /* scope_0_fallback */,
 };
 
-static struct
+static const struct
 {
   gchar *name;
   guint token;
@@ -172,7 +172,7 @@ static struct
   { "module_path", GTK_RC_TOKEN_MODULE_PATH },
 };
 
-static guint n_symbols = sizeof (symbols) / sizeof (symbols[0]);
+static const guint n_symbols = sizeof (symbols) / sizeof (symbols[0]);
 
 static GHashTable *rc_style_ht = NULL;
 static GHashTable *realized_style_ht = NULL;
index 2b25500f047d14a339ccf9a4fbd195260df13661..986e84a035ccd5009e1406b9e70b64e64c09314e 100644 (file)
@@ -32,7 +32,7 @@ static void gtk_ruler_make_pixmap   (GtkRuler       *ruler);
 
 static GtkWidgetClass *parent_class;
 
-static GtkRulerMetric ruler_metrics[] =
+static const GtkRulerMetric ruler_metrics[] =
 {
   {"Pixels", "Pi", 1.0, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }},
   {"Inches", "In", 72.0, { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 }, { 1, 2, 4, 8, 16 }},
@@ -47,7 +47,7 @@ gtk_ruler_get_type (void)
 
   if (!ruler_type)
     {
-      GtkTypeInfo ruler_info =
+      static const GtkTypeInfo ruler_info =
       {
        "GtkRuler",
        sizeof (GtkRuler),
index 31e9468058db0182e662a77c14436b96e9d6aba2..ca3dffff77175bce87b243ad5c8091964f648abe 100644 (file)
@@ -42,7 +42,7 @@ gtk_scale_get_type (void)
 
   if (!scale_type)
     {
-      GtkTypeInfo scale_info =
+      static const GtkTypeInfo scale_info =
       {
        "GtkScale",
        sizeof (GtkScale),
index 97bc35db05714d51b520e60c0952eeda48f7950e..68db4d988ae098b5193693f4ee2beab7cfabee98 100644 (file)
@@ -28,7 +28,7 @@ gtk_scrollbar_get_type (void)
 
   if (!scrollbar_type)
     {
-      GtkTypeInfo scrollbar_info =
+      static const GtkTypeInfo scrollbar_info =
       {
        "GtkScrollbar",
        sizeof (GtkScrollbar),
index d31b6d86ea0f98e44363f60e20ca22cc2b7442e1..c447aaa9f76a4c58f86e1fb4eabfce50cb81e504 100644 (file)
@@ -74,7 +74,7 @@ gtk_scrolled_window_get_type (void)
 
   if (!scrolled_window_type)
     {
-      GtkTypeInfo scrolled_window_info =
+      static const GtkTypeInfo scrolled_window_info =
       {
        "GtkScrolledWindow",
        sizeof (GtkScrolledWindow),
index e3bd8fc793163c2fb03e3cc68f55bf04d932bd24..b4d9e643b2b324309643adf177510589b75fb638 100644 (file)
@@ -30,7 +30,7 @@ gtk_separator_get_type (void)
 
   if (!separator_type)
     {
-      GtkTypeInfo separator_info =
+      static const GtkTypeInfo separator_info =
       {
        "GtkSeparator",
        sizeof (GtkSeparator),
index c8d8e2bca3014d2d15431f94298000307e4a6d1b..b281bf5b5c269b75529bc72cf0805715f40d315d 100644 (file)
@@ -67,7 +67,7 @@ gtk_socket_get_type ()
 
   if (!socket_type)
     {
-      GtkTypeInfo socket_info =
+      static const GtkTypeInfo socket_info =
       {
        "GtkSocket",
        sizeof (GtkSocket),
index 08e21678f78cc49fd20e2c1a34ab5de1c6b886ed..6a129a5e01fab17d6e8c577ac780cd7fe36953a6 100644 (file)
@@ -119,7 +119,7 @@ gtk_spin_button_get_type (void)
 
   if (!spin_button_type)
     {
-      GtkTypeInfo spin_button_info =
+      static const GtkTypeInfo spin_button_info =
       {
        "GtkSpinButton",
        sizeof (GtkSpinButton),
index cfc3e4c45f22257782ba7a6385b52fbebc014ccc..9cca6fd55b5708223c51355480dda86d51578f1e 100644 (file)
@@ -49,7 +49,7 @@ gtk_statusbar_get_type (void)
 
   if (!statusbar_type)
     {
-      GtkTypeInfo statusbar_info =
+      static const GtkTypeInfo statusbar_info =
       {
         "GtkStatusbar",
         sizeof (GtkStatusbar),
index 4574cfe8f54f20d0a3e0f3ce601d6e314996b3e7..3765fdc460a66c0f0a805b844f92af955281ea39 100644 (file)
@@ -287,7 +287,7 @@ static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b);
 static void hls_to_rgb (gdouble *h, gdouble *l, gdouble *s);
 
 
-GtkStyleClass default_class =
+static const GtkStyleClass default_class =
 {
    2,
    2,
index 313dad2243cb89d80b65936c53fc5b22bdc5f0d6..d47fe498f90d81a676cdabab0597f902ef433bd3 100644 (file)
@@ -100,7 +100,7 @@ gtk_table_get_type (void)
   
   if (!table_type)
     {
-      GtkTypeInfo table_info =
+      static const GtkTypeInfo table_info =
       {
        "GtkTable",
        sizeof (GtkTable),
index fb76f1010b1a4d7997dea7eeea2dedc6973bef8a..18a53b46e1422e1127508d0d14cbcb002dcec76f 100644 (file)
@@ -43,7 +43,7 @@ gtk_tearoff_menu_item_get_type (void)
 
   if (!tearoff_menu_item_type)
     {
-      GtkTypeInfo tearoff_menu_item_info =
+      static const GtkTypeInfo tearoff_menu_item_info =
       {
         "GtkTearoffMenuItem",
         sizeof (GtkTearoffMenuItem),
index 0603485e042ff5e65d0de4c2d9a9ab6c027d199b..ee6833dcaf807e0de006bc9293f0cf10c4146f31 100644 (file)
@@ -432,7 +432,7 @@ static GMemChunk  *text_property_chunk = NULL;
 static GtkWidgetClass *parent_class = NULL;
 
 
-static GtkTextFunction control_keys[26] =
+static const GtkTextFunction control_keys[26] =
 {
   (GtkTextFunction)gtk_text_move_beginning_of_line,    /* a */
   (GtkTextFunction)gtk_text_move_backward_character,   /* b */
@@ -462,7 +462,7 @@ static GtkTextFunction control_keys[26] =
   NULL,                                                /* z */
 };
 
-static GtkTextFunction alt_keys[26] =
+static const GtkTextFunction alt_keys[26] =
 {
   NULL,                                                /* a */
   (GtkTextFunction)gtk_text_move_backward_word,        /* b */
@@ -504,7 +504,7 @@ gtk_text_get_type (void)
   
   if (!text_type)
     {
-      GtkTypeInfo text_info =
+      static const GtkTypeInfo text_info =
       {
        "GtkText",
        sizeof (GtkText),
index e54cf5a2506347ab648d99be7bff1c4e029e69bc..2c8b03767296967e169d8a39bc2a75c2b00e0b16 100644 (file)
@@ -79,7 +79,7 @@ gtk_tips_query_get_type (void)
 
   if (!tips_query_type)
     {
-      GtkTypeInfo tips_query_info =
+      static const GtkTypeInfo tips_query_info =
       {
        "GtkTipsQuery",
        sizeof (GtkTipsQuery),
index a391e1dc853bc097f3228f4388fc051a0d6c46ff..cccbc49e8d0e7631372cad4758076633838060da 100644 (file)
@@ -71,7 +71,7 @@ gtk_toggle_button_get_type (void)
 
   if (!toggle_button_type)
     {
-      GtkTypeInfo toggle_button_info =
+      static const GtkTypeInfo toggle_button_info =
       {
        "GtkToggleButton",
        sizeof (GtkToggleButton),
index ab9d2754ac288de19143c7cae90329d502773227..3db47e656b748e204898783e5c24799a45d51f49 100644 (file)
@@ -74,7 +74,7 @@ gtk_toolbar_get_type (void)
 
   if (!toolbar_type)
     {
-      GtkTypeInfo toolbar_info =
+      static const GtkTypeInfo toolbar_info =
       {
        "GtkToolbar",
        sizeof (GtkToolbar),
index 123c37c8576be2337dcc6c2ae0f0c54b0f711f7c..a1820d742a67ea14ed7d0a7d5ad2ce2bd95fcc25 100644 (file)
@@ -58,7 +58,7 @@ gtk_tooltips_get_type (void)
 
   if (!tooltips_type)
     {
-      GtkTypeInfo tooltips_info =
+      static const GtkTypeInfo tooltips_info =
       {
        "GtkTooltips",
        sizeof (GtkTooltips),
index 2f70b4c7f2b55517d43dc35c4e3d6ccef182f812..e94c35fdff33c1116ffa5e210ce7c7cf334d171f 100644 (file)
@@ -73,7 +73,7 @@ gtk_tree_get_type (void)
   
   if (!tree_type)
     {
-      GtkTypeInfo tree_info =
+      static const GtkTypeInfo tree_info =
       {
        "GtkTree",
        sizeof (GtkTree),
index a4f57e3d5f3d5f1f14b09221d2cb5ba723589b9e..53bb5e58a6384295f03f007ed50280bcf2e0ccac 100644 (file)
@@ -99,7 +99,7 @@ gtk_tree_item_get_type (void)
 
   if (!tree_item_type)
     {
-      GtkTypeInfo tree_item_info =
+      static const GtkTypeInfo tree_item_info =
       {
        "GtkTreeItem",
        sizeof (GtkTreeItem),
index c9b415ad7e01df154b2611e66951eea0e9ded605..b7fcf60f5e468916958365129688029d954291ae 100644 (file)
@@ -162,7 +162,7 @@ gtk_type_set_chunk_alloc (GtkType      type,
 static GtkType
 gtk_type_create (GtkType      parent_type,
                 gchar        *type_name,
-                GtkTypeInfo *type_info)
+                const GtkTypeInfo *type_info)
 {
   GtkTypeNode *new_node;
   GtkTypeNode *parent;
@@ -230,7 +230,7 @@ gtk_type_create (GtkType      parent_type,
 
 GtkType
 gtk_type_unique (GtkType      parent_type,
-                GtkTypeInfo *type_info)
+                const GtkTypeInfo *type_info)
 {
   GtkType new_type;
   gchar *type_name;
@@ -915,7 +915,7 @@ gtk_type_init_builtin_types (void)
    * gtk_type_unique is 1, which is GTK_TYPE_NONE.  And so on.
    */
   
-  struct {
+  static const struct {
     GtkType type_id;
     gchar *name;
   } fundamental_info[] = {
@@ -941,7 +941,7 @@ gtk_type_init_builtin_types (void)
     { GTK_TYPE_C_CALLBACK,     "GtkCCallback" },
     { GTK_TYPE_FOREIGN,                "GtkForeign" },
   };
-  struct {
+  static struct {
     gchar *type_name;
     GtkType *type_id;
     GtkType parent;
index ae2fe399b8962ca6307441c53804b4a51bd98d98..40e70c2c40858fa33db2531e84eb282752c6a4dc 100644 (file)
@@ -311,8 +311,8 @@ struct _GtkEnumValue
 
 
 void           gtk_type_init                   (void);
-GtkType                gtk_type_unique                 (GtkType         parent_type,
-                                                GtkTypeInfo    *type_info);
+GtkType                gtk_type_unique                 (GtkType           parent_type,
+                                                const GtkTypeInfo *type_info);
 void           gtk_type_set_chunk_alloc        (GtkType         type,
                                                 guint           n_chunks);
 gchar*         gtk_type_name                   (guint           type);
index 958a1236e04852b1183a82995184b7dbff16f6a9..cc83202517cb3f6ffa53777d0b815c40d2d5bc73 100644 (file)
@@ -36,7 +36,7 @@ gtk_vbutton_box_get_type (void)
 
   if (!vbutton_box_type)
     {
-      GtkTypeInfo vbutton_box_info =
+      static const GtkTypeInfo vbutton_box_info =
       {
        "GtkVButtonBox",
        sizeof (GtkVButtonBox),
index be40bdb7ca43076dfd9ca9fabcdc7ace29e104dc..486b89706f64fa7572a2ec785c65d9d9dbf111ad 100644 (file)
@@ -34,7 +34,7 @@ gtk_vbox_get_type (void)
 
   if (!vbox_type)
     {
-      GtkTypeInfo vbox_info =
+      static const GtkTypeInfo vbox_info =
       {
        "GtkVBox",
        sizeof (GtkVBox),
index b88858e868f0a63d9a73bac3cc536b242514e4e5..504b8f092feb5e5d4bb306e101b6e1d601578b75 100644 (file)
@@ -72,7 +72,7 @@ gtk_viewport_get_type (void)
 
   if (!viewport_type)
     {
-      GtkTypeInfo viewport_info =
+      static const GtkTypeInfo viewport_info =
       {
        "GtkViewport",
        sizeof (GtkViewport),
index 55cd2b9bf465915ce112849fae7a643050db5937..3fb5a1a2e8a844d9f82daaf468a75ff8f5effce5 100644 (file)
@@ -43,7 +43,7 @@ gtk_vpaned_get_type (void)
 
   if (!vpaned_type)
     {
-      GtkTypeInfo vpaned_info =
+      static const GtkTypeInfo vpaned_info =
       {
        "GtkVPaned",
        sizeof (GtkVPaned),
index 3da583548d032ac857b4c0332bcecedf5cc05d6b..93117fe395c454d40990edae2567860ebb785545 100644 (file)
@@ -45,7 +45,7 @@ gtk_vruler_get_type (void)
 
   if (!vruler_type)
     {
-      GtkTypeInfo vruler_info =
+      static const GtkTypeInfo vruler_info =
       {
        "GtkVRuler",
        sizeof (GtkVRuler),
index b60425ce2c2dae57d73ab1ffd2e2bee90b4d0085..25a453c1b8bfa6d7aec22d7e142c1f37a1218da6 100644 (file)
@@ -70,7 +70,7 @@ gtk_vscale_get_type (void)
   
   if (!vscale_type)
     {
-      GtkTypeInfo vscale_info =
+      static const GtkTypeInfo vscale_info =
       {
         "GtkVScale",
         sizeof (GtkVScale),
index 3cb8d50051df79dfb0b234046e3d29f1474ba84f..d4485283ec01017c54ff0d580fbfc440a7331a21 100644 (file)
@@ -58,7 +58,7 @@ gtk_vscrollbar_get_type (void)
   
   if (!vscrollbar_type)
     {
-      GtkTypeInfo vscrollbar_info =
+      static const GtkTypeInfo vscrollbar_info =
       {
         "GtkVScrollbar",
         sizeof (GtkVScrollbar),
index dac67f20c818eb375d453bb440dc57d7251511f8..bd73d350568fe49ddb069bee7f822b66c9d9d538 100644 (file)
@@ -32,7 +32,7 @@ gtk_vseparator_get_type (void)
 
   if (!vseparator_type)
     {
-      GtkTypeInfo vseparator_info =
+      static const GtkTypeInfo vseparator_info =
       {
        "GtkVSeparator",
        sizeof (GtkVSeparator),
index de9339ec524520c6bc23d88be9436e1613024b7f..92e13f1cc10a209718ad1f580b26766e1ac66fa0 100644 (file)
@@ -218,7 +218,7 @@ gtk_widget_get_type (void)
   
   if (!widget_type)
     {
-      GtkTypeInfo widget_info =
+      static const GtkTypeInfo widget_info =
       {
        "GtkWidget",
        sizeof (GtkWidget),
index b078b4891df8215007534f567a455764771b5e1b..41e59e8d2eece697ae9b4a046bb601fede1c4089 100644 (file)
@@ -107,7 +107,7 @@ gtk_window_get_type (void)
 
   if (!window_type)
     {
-      GtkTypeInfo window_info =
+      static const GtkTypeInfo window_info =
       {
        "GtkWindow",
        sizeof (GtkWindow),
index a6e447057ac974551f3adf07d1c4458bee5838b3..62fb6c19a11c6bd9d0f3fec29fcd21c129d6bd20 100755 (executable)
@@ -204,7 +204,7 @@ while (<>) {
             $valuename =~ s/([A-Z][A-Z])([A-Z][0-9a-z])/$1_$2/g;
             $valuename = lc($valuename);
 
-           print "static GtkEnumValue _${valuename}_values[] = {\n";
+           print "static const GtkEnumValue _${valuename}_values[] = {\n";
            for (@entries) {
                my ($name,$nick) = @{$_};
                print qq(  { $name, "$name", "$nick" },\n);